﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucTimKiemGiangVien.ascx.cs"
    Inherits="STT.Admin.UserControls.ucTimKiemGiangVien" %>
<%@ Register Assembly="Microsoft.ReportViewer.WebForms, Version=11.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" Namespace="Microsoft.Reporting.WebForms" TagPrefix="rsweb" %>
<%--<asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>--%>
<%--<div id="content-header">
    <div id="breadcrumb">
        <a href="../Admin/Default.aspx?idpage=1" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chính
        </a>
        <a href="../Admin/Default.aspx?" class="current">Tìm kiếm</a>
        <a href="../Admin/Default.aspx?" class="current">Tìm kiếm giảng viên</a>
    </div>
</div>--%>
<div class="widget-box collapsible">
    <div class="widget-title">
        <a href="#collapseOne" data-toggle="collapse" class="">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Điều kiện tìm kiếm giảng viên</h5>
        </a>
    </div>

    <div class="in" id="collapseOne" style="height: auto;">
        <div class="widget-content nopadding">
            <div class="dataTables_wrapper" role="grid">
                <%-- Cac dieu kien tim kiem --%>
                <div class="container-fluid">
                    <div class="row-fluid">
                        <div class="span6">

                            <div class="control-group">
                                <label class="control-label">Mã giảng viên: </label>
                                <div class="controls">
                                    <asp:TextBox ID="txtMaGiangVien" runat="server" class="span20" placeholder="Mã giảng viên"></asp:TextBox>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">Tên giảng viên: </label>
                                <div class="controls">
                                    <asp:TextBox ID="txtTenGiangVien" runat="server" class="span20" placeholder="Tên giảng viên"></asp:TextBox>
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label">Số khóa học dạy: </label>
                                <div class="controls">
                                    <asp:TextBox ID="txtSoKhoaHocDay" runat="server" class="span20" placeholder="Số khóa học dạy"></asp:TextBox>
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label">Chức vụ :</label>
                                <div class="controls">
                                    <asp:DropDownList ID="ddChucVu" runat="server" CssClass="span20"></asp:DropDownList>
                                </div>
                            </div>
                        </div>

                        <div class="span6">
                            <div class="control-group">
                                <label class="control-label">Đơn vị giảng dạy :</label>
                                <div class="controls">
                                    <asp:DropDownList ID="ddDonVi" runat="server" CssClass="span20"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">Chuyên môn :</label>
                                <div class="controls">
                                    <asp:DropDownList ID="ddChuyenMon" runat="server" CssClass="span20"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">Học vấn :</label>
                                <div class="controls">
                                    <asp:DropDownList ID="ddHocVan" runat="server" CssClass="span20"></asp:DropDownList>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">Trình độ ngoại ngữ :</label>
                                <div class="controls">
                                    <asp:DropDownList ID="ddTrinhDoNgoaiNgu" runat="server" CssClass="span20"></asp:DropDownList>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
                    <asp:Button ID="btTimKiem" runat="server" Text="Tìm kiếm" CssClass="btn btn-info"
                        OnClick="btTimKiem_Click" />
                </div>
            </div>
        </div>
    </div>
    <%-- Gridview ket qua tim kiem --%>
    <div class="widget-title">
        <a href="#collapseTwo" data-toggle="collapse" class="">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Kết quả tìm kiếm</h5>
        </a>
    </div>
    <rsweb:ReportViewer ID="rpvGiangVien" runat="server" Font-Names="Verdana" Font-Size="8pt" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt" Width="933px" Height="900px" Visible="False">
        <LocalReport ReportPath="RDLC\TKGiangVien.rdlc">
        </LocalReport>

    </rsweb:ReportViewer>
    <div class="in collapse" id="collapseTwo" style="height: auto;">
        <div class="widget-content nopadding">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">

                <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
                </div>
            </div>
        </div>
    </div>
</div>

<div id="thongTin" class="modal hide" aria-hidden="true" style="display: none;">
    <div class="modal-header">
        <button data-dismiss="modal" class="close" type="button">×</button>
        <h3>Thông tin chi tiết</h3>
    </div>
    <div class="modal-body">
        <div class="control-group">
            <label class="control-label">Mã giảng viên: </label>
            <div class="controls">
                <label id="txtMa"></label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Tên giảng viên: </label>
            <div class="controls">
                <label id="txtTen"></label>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">Các lớp đã dạy: </label>
            <div class="controls" id="txtDanhSach">
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <a data-dismiss="modal" class="btn" href="#">Ẩn</a>
    </div>
</div>

<script>

    function GetThongTin(obj) {
        var Ma = $.trim($(obj).attr('class'));
        var Ten = $(obj).parent().parent().find(':nth-child(3)').text();

        $.ajax({
            type: "POST",
            url: "Default.aspx/LayThongTinGiangVien",
            data: '{MaGiangVien: "' + Ma + '"}',
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            success: function (response) {
                OnSuccess(response, Ma, Ten)
            },
            failure: function (response) {
                alert('Không kết nối được!');
            },
            error: function (response) {
                alert('Có lỗi xảy ra!');
            }
        });
    }

    function OnSuccess(response, Ma, Ten) {
        var xmlDoc = $.parseXML(response.d);
        var xml = $(xmlDoc);
        var rows = xml.find("Row");

        $('#txtMa').text(Ma);
        $('#txtTen').text(Ten);

        var str = '';
        $.each(rows, function () {
            var row = $(this);
            str += '<span>' + $(this).find("TenLop").text() + '</span>';
        });

        $('#txtDanhSach').html(str);
    }
</script>

<%--  </ContentTemplate>
</asp:UpdatePanel>--%>


